package com.xqh.spider;

import com.xqh.entity.ques.Vocabulary;

import java.util.concurrent.Callable;

/**
 * 爬取 单个 词汇
 */
public class SpiderWordThread implements Callable<Vocabulary> {

    private String word;

    public SpiderWordThread(String word){
        this.word = word;
    }

    @Override
    public Vocabulary call(){
        try {
            return SpiderWordTools.spiderWord(word);
        }catch (Exception e){
            Vocabulary vocab = new Vocabulary();
            vocab.setText(word);
            vocab.setSpiderFail(true);
            return vocab;
        }
    }
}
